package JiChu;

public class Zifu {
    public static void main(String[] args) {

        String text1 = "苏帅";
        String text2 = "苏帅";

        int hashCode1 = text1.hashCode();
        System.out.println("第一次计算text1的哈希值: " + hashCode1);

        int hashCode1Cached = text1.hashCode();
        System.out.println("第二次计算 :" + hashCode1Cached);

        int hashCode2 = text2.hashCode();
        System.out.println("text2 直接使用缓存:" + hashCode2);
    }
}
